import { createApp } from 'vue'
import { setupStore } from '@/stores'
import App from './App.vue'
import router from './router'
import ElementPlus from 'element-plus'
// 引入重置样式
import './style/reset.scss'
// 导入公共样式
import './style/index.scss'
import './style/tailwind.css'
import 'element-plus/dist/index.css'
import 'nprogress/nprogress.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import { Icon } from '@iconify/vue'
import { addCollection } from '@iconify/vue'
import mdiIconsData from '@iconify-json/mdi/icons.json'
import epIconsData from '@iconify-json/ep/icons.json'

const app = createApp(App)

setupStore(app)
app.use(router)
app.use(ElementPlus, { size: 'small', zIndex: 3000 })

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
// 注册离线图标数据
addCollection(mdiIconsData)
addCollection(epIconsData)

app.component('Icon', Icon)
app.mount('#app')
